import logging
import yagmail

def log_set():
    logging.basicConfig(
        level=logging.DEBUG,
        format='%(filename)s_%(module)s_%(lineno)d',
        handlers=[
            logging.StreamHandler(),
            logging.FileHandler('log.txt')
        ]
    )
def smtp_log(a):
    logging=yagmail.SMTP(
        user='768048563@qq.com',
        password='bkuzmcdjfmmhbedi',
        host='smtp.qq.com'
    )
    logging.send(
        to='768048563@qq.com',
        subject='测试标题',
        contents='测试内容',
        attachments=a
    )

